fix: index onboarding and org deploy configs at template creation#154
Merged
fix: index onboarding and org deploy configs at template creation#154
Conversation
The OnboardingConfigUpdated and OrgDeployConfigUpdated events are emitted during deployment (via adminCall) BEFORE registerInfrastructure creates the PaymasterHub template. This means the subgraph never indexes these events, leaving OnboardingConfig and OrgDeployConfig entities empty. Fix: In handleInfrastructureDeployed, after creating the PaymasterHub template, read the current config state from the contract using try_getOnboardingConfig() and try_getOrgDeployConfig(), and populate the entities. Same pattern already used for solidarity fund balance and PaymasterInitialized data. Also reads getGracePeriodConfig() to get accurate grace period values instead of hardcoded defaults. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OnboardingConfig and OrgDeployConfig subgraph entities were always empty because their events (
OnboardingConfigUpdated,OrgDeployConfigUpdated) fire during deployment BEFOREregisterInfrastructurecreates the PaymasterHub template. The subgraph misses events emitted before its template exists.Root cause
Deployment sequence (Gnosis):
setOnboardingConfigcalled →OnboardingConfigUpdatedemittedsetOrgDeployConfigcalled →OrgDeployConfigUpdatedemittedregisterInfrastructurecalled → PaymasterHub template createdEvents at blocks 22-23 are missed because the template doesn't exist until block 29.
Fix
In
handleInfrastructureDeployed, after creating the template, read the current config state from the contract usingtry_getOnboardingConfig()andtry_getOrgDeployConfig(). This is the same pattern already used for the solidarity fund balance (try_getSolidarityFund()).Also reads
try_getGracePeriodConfig()for accurate grace period values instead of hardcoded defaults.Build
graph codegen✓,graph build✓After deploying
Both Arbitrum and Gnosis subgraphs need redeployment. After reindexing, the /protocol dashboard's Paymaster Configuration section will show the correct config values.
🤖 Generated with Claude Code